<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>分类列表</title>
	<meta name="description" content="Static & Dynamic Tables" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<!-- basic styles -->
	<script type='text/javascript' src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/jquery-1.8.2.min.js'></script>
<link href='http://localhost/qm_shop/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/qm_shop/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/qm_shop';
		WEB = 'http://localhost/qm_shop/index.php';
		URL = 'http://localhost/qm_shop/index.php/Admin/Category/index';
		HDPHP = 'http://localhost/qm_shop/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/qm_shop/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/qm_shop/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/qm_shop/hdphp/hdphp/Extend';
		APP = 'http://localhost/qm_shop/index.php/Admin';
		CONTROL = 'http://localhost/qm_shop/index.php/Admin/Category';
		METH = 'http://localhost/qm_shop/index.php/Admin/Category/index';
		GROUP = 'http://localhost/qm_shop/./Qmshop';
		TPL = 'http://localhost/qm_shop/./Qmshop/App/Admin/Tpl';
		CONTROLTPL = 'http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Category';
		STATIC = 'http://localhost/qm_shop/Static';
		PUBLIC = 'http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public';
		HISTORY = 'http://localhost/qm_shop/index.php/Admin/Index/index';
		HTTPREFERER = 'http://localhost/qm_shop/index.php/Admin/Index/index';
</script>
	<link href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/bootstrap.min.css" rel="stylesheet" />
	<link href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/bootstrap-responsive.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/font-awesome.min.css" />
	<!--[if IE 7]>
	  <link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/font-awesome-ie7.min.css" />
	<![endif]-->
	<!-- page specific plugin styles -->
	
	<!-- ace styles -->
	<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/ace.min.css" />
	<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/ace-responsive.min.css" />
	<link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/ace-skins.min.css" />
	<!--[if lt IE 9]>
	  <link rel="stylesheet" href="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/css/ace-ie.min.css" />
	<![endif]-->
</head>
<body>

	<div class="container-fluid" id="main-container">

		<!-- PAGE CONTENT BEGINS HERE -->
		<div class="row-fluid">
			<div class="table-header">
				分类管理 | <a style="font-size:14px;">分类列表</a>
			</div>
			<ul class="nav nav-tabs cate_tab" id="myTab">
				<li <?php if($_GET['pid'] == 0){?>class="active"<?php }?>
				><a href="<?php echo U('Category/index');?>"><i class="green icon-home bigger-110"></i>全部分类</a></li>
				<?php if(is_array($topCate)):?><?php  foreach($topCate as $v){ ?>
					<li
					<?php if($_GET['pid'] == $v['cid']){?>class="active"<?php }?>
					><a href="<?php echo U('Category/index',array('cid'=>$v['cid']));?>"><?php echo $v['cname'];?> <span class="badge badge-important"><?php echo $v['csort'];?></span></a></li>
				<?php }?><?php endif;?>
			</ul>
			<table id="table_report" class="table table-striped table-bordered table-hover">
				<thead>
					<tr pid=0>
						<th class="center">
							<label><input type="checkbox" /><span class="lbl"></span></label>
						</th>
						<th class="hidden-480">CID</th>
						<th>分类名称</th>
						<th class="hidden-phone">PID</th>
						<th>分类排序</th>
						<th class="hidden-480">分类logo</th>
						<th style="width:220px;">操作</th>
					</tr>
				</thead>
								
				<tbody>
					<?php if(is_array($cate)):?><?php  foreach($cate as $value){ ?>
						<tr cid=<?php echo $value['cid'];?> pid=<?php echo $value['cpid'];?>>
							<td class='center'>
								<label><input type='checkbox' /><span class="lbl"></span></label>
							</td>
							<td class='hidden-480'><?php echo $value['_html'];?><?php echo $value['cid'];?></td>
							<td><a href='javascript:'><?php echo $value['_html'];?><?php echo $value['cname'];?></a></td>
							<td><?php echo $value['cpid'];?></td>
							<td class='hidden-phone'><?php echo $value['_html'];?><?php echo $value['csort'];?></td>
							<td class='hidden-480 clogobox'>
								<?php if(!empty($value['clogo'])){?>
									<?php echo $value['clogo'];?>
									<img src="http://localhost/qm_shop/<?php echo $value['clogo'];?>">
								<?php  }else{ ?>
									该分类没有logo图片
								<?php }?>
							</td>
								<style type="text/css">
									.clogobox{
										display: inline-block;
										position: relative;
										cursor: pointer;
										width: 100%;
										height: 100%;
									}
									.clogobox img{
										position: absolute;
										left: 130px;
										top:-20px;
										z-index: 1;
										display: none;
										border: 1px solid #DDDDDD;
										border-radius: 10px;
										box-shadow: 0 5px 15px rgba(0,0,0,0.1);
										width: 200px;
										height: 115px;
									}
								</style>
								<script type="text/javascript">
									$('.clogobox').hover(function() {
										$(this).find('img').show();
									}, function() {
										$(this).find('img').hide();
									});
								</script>
							<td style="width:220px;">
								<div class='hidden-phone visible-desktop btn-group'>
									<a href="<?php echo U('edit_cate',array('cid'=>$value['cid']));?>" class="btn btn-mini btn-success tooltip-success" data-rel="tooltip" title="" data-placement="left"><i class="icon-edit">修改</i></a>
									<a href="javascript:" class="btn btn-mini btn-danger tooltip-error" data-rel="tooltip" title="" data-placement="left" onclick="if(confirm('确定要删除吗？')) hd_ajax('<?php echo U('del_cate',array('cid'=>$value['cid']));?>')"><i class="icon-trash">删除</i></a>	
									<a href="<?php echo U('add_cate',array('cid'=>$value['cid']));?>" class="btn btn-mini btn-warning tooltip-warning" data-rel="tooltip" data-placement="left"><i class="icon-flag">添加子分类</i></a>
								</div>
							</td>
						</tr>
					<?php }?><?php endif;?>
				</tbody>
			</table>
		</div>
		<!-- PAGE CONTENT ENDS HERE -->
	
	</div><!-- #main-content -->
	

	<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
		<i class="icon-double-angle-up icon-only"></i>
	</a>
	<!-- basic scripts -->
	<script src="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/js/bootstrap.min.js"></script>
	<!-- page specific plugin scripts -->
	
	<script type="text/javascript" src="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/js/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/js/jquery.dataTables.bootstrap.js"></script>
	<!-- ace scripts -->
	<script src="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/js/ace-elements.min.js"></script>
	<script src="http://localhost/qm_shop/./Qmshop/App/Admin/Tpl/Public/js/ace.min.js"></script>
	<!-- inline scripts related to this page -->
	
	<script type="text/javascript">
	$(function() {
		var oTable1 = $('#table_report').dataTable( {
		"aoColumns": [
	      { "bSortable": false },
	      null, null,null, null, null,
		  { "bSortable": false }
		] } );
		$('[data-rel=tooltip]').tooltip();
		})
	</script>
</body>
</html>